// 控制台相关类型定义

// 分页查询基类
export interface PagedQueryDto {
  pageIndex: number
  pageSize: number
  keyword?: string
}

// 分页结果
export interface PagedResultDto<T> {
  items: T[]
  totalCount: number
  pageIndex: number
  pageSize: number
  totalPages: number
}

// 核心指标DTO
export interface CoreMetricsDto {
  id: number
  date: string
  salesRevenue: number
  salesOrderCount: number
  collection: number
  purchaseExpense: number
  purchaseOrderCount: number
  paidAmount: number
  remarks?: string
}

// 统计数据查询DTO
export interface StatisticsQueryDto {
  startDate?: string
  endDate?: string
  type?: string
  timeRange?: string
}

// 统计数据DTO
export interface StatisticsDto {
  id: number
  date: string
  type: string
  orderAmount: number
  orderCount: number
  timeRange?: string
  remarks?: string
}

// 通知公告查询DTO
export interface AnnouncementQueryDto extends PagedQueryDto {
  type?: string
  isActive?: boolean
}

// 通知公告DTO
export interface AnnouncementDto {
  id: number
  content: string
  type: string
  priority: number
  isActive: boolean
  publishTime?: string
  expiryTime?: string
  publisher?: string
  targetUserGroup?: string
  remarks?: string
  createTime: string
  creator?: string
}

// 采购订单查询DTO
export interface PurchaseOrderQueryDto extends PagedQueryDto {
  status?: string
  orderType?: string
}

// 采购订单DTO
export interface PurchaseOrderDto {
  id: number
  orderNumber: string
  subject: string
  orderType: string
  status: string
  totalAmount: number
  supplierId?: number
  supplierName?: string
  expectedArrivalDate?: string
  remarks?: string
  createTime: string
  creator?: string
}

// 生产工单查询DTO
export interface ProductionOrderQueryDto extends PagedQueryDto {
  status?: string
  responsiblePerson?: string
}

// 生产工单DTO
export interface ProductionOrderDto {
  id: number
  orderNumber: string
  productionItem: string
  status: string
  plannedStartTime?: string
  plannedIntroTime?: string
  actualStartTime?: string
  actualCompletionTime?: string
  responsiblePerson?: string
  plannedQuantity: number
  actualQuantity: number
  priority: number
  remarks?: string
  createTime: string
  creator?: string
}

// 销售订单查询DTO
export interface ProductionSalesOrderQueryDto extends PagedQueryDto {
  status?: string
  customerName?: string
}

// 销售订单DTO
export interface ProductionSalesOrderDto {
  id: number
  orderNumber: string
  subject: string
  orderType: string
  status: string
  deliveryDate?: string
  totalAmount: number
  customerId?: number
  customerName?: string
  remarks?: string
  createTime: string
  creator?: string
}

// 审批单据查询DTO
export interface ApprovalDocumentQueryDto extends PagedQueryDto {
  documentType?: string
  status?: string
}

// 审批单据DTO
export interface ApprovalDocumentDto {
  id: number
  documentType: string
  documentId: number
  documentNumber?: string
  status: string
  priority: number
  applicant?: string
  applicationTime?: string
  approver?: string
  approvalTime?: string
  approvalComments?: string
  remarks?: string
  createTime: string
  creator?: string
}

// 仓库查询DTO
export interface WarehouseQueryDto extends PagedQueryDto {
  warehouseType?: string
  status?: string
}

// 仓库DTO
export interface WarehouseDto {
  id: number
  warehouseName: string
  location?: string
  warehouseType?: string
  manager?: string
  contactPhone?: string
  status: string
  remarks?: string
  createTime: string
  creator?: string
}

// 生产物品查询DTO
export interface ProductionItemQueryDto extends PagedQueryDto {
  itemType?: string
  warehouseId?: number
}

// 生产物品DTO
export interface ProductionItemDto {
  id: number
  itemNumber: string
  itemName: string
  batchNumber?: string
  productionDate?: string
  expiryDate?: string
  warehouseId?: number
  warehouseName?: string
  inventoryQuantity: number
  itemType?: string
  specification?: string
  unit?: string
  unitPrice?: number
  remarks?: string
  createTime: string
  creator?: string
}

// 工序查询DTO
export interface ProcessQueryDto extends PagedQueryDto {
  status?: string
  processType?: string
}

// 工序DTO
export interface ProcessDto {
  id: number
  documentNumber: string
  processName: string
  status: string
  plannedStartTime?: string
  plannedIntroTime?: string
  actualStartTime?: string
  actualCompletionTime?: string
  responsiblePerson?: string
  processType?: string
  description?: string
  priority: number
  remarks?: string
  createTime: string
  creator?: string
}

// 待审批单据统计
export interface ApprovalCountDto {
  documentType: string
  count: number
  icon: string
  iconClass: string
}

// 图表数据
export interface ChartDataDto {
  // 时间标签（X轴）
  TimeLabels: string[]
  // 订单金额数据（Y轴）
  orderAmounts: number[]
  // 订单数量数据（Y轴）
  orderCounts: number[]
  // 时间范围
  timeRange: string
  // 统计类型（sales/purchase）
  type: string
} 